macro(prepare_unittest)
    set(staticLib)
endmacro()

macro(set_unittest)
    include_directories(${PROJECT_SOURCE_DIR}/code/inc)

    set(staticLibDir)

    # message(FATAL_ERROR $ENV{LOCAL_CXX_LIBS_PATH})
    # 设置本地安装库
    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} $ENV{LOCAL_CXX_LIBS_PATH})
    set(CMAKE_PREFIX_PATH $ENV{LOCAL_CXX_LIBS_PATH})

    ###########################
    # gtest静态库
    ###########################
    find_package(GTest REQUIRED)
    set(staticLib ${staticLib} GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main pthread)
    # set(staticLib ${staticLib} ${GTEST_BOTH_LIBRARIES} pthread)


    ###########################
    # 包含 cpp-stub 头文件
    ###########################
    find_package(cpp-stub REQUIRED)
    set(staticLib ${staticLib} cpp-stub::cpp-stub)

    ###########################
    # 启用ctest
    ###########################
    include(CTest)
    enable_testing()

    # 指定链接目录
    link_directories(${staticLibDir})

    # 包含测试源码
    add_subdirectory(unittest)
endmacro(set_unittest)
